Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ES client to 8.1.0-canary.2 #119791

Merged
merged 75 commits into from
Dec 24, 2021
Merged

Conversation

mshustov
Copy link
Contributor

@mshustov mshustov commented Nov 28, 2021

Summary

Closes #119454
Closes #116111

Important changes:

Aggregations

In this PR, I declared definitions as

interface MyAgg extends AggregationsMultiBucketAggregateBase {
   buckets: MyType[];
}

const response = client.serch<unknown, MyAgg>(...);

I use extends to enforce buckets compatbility. ES client type definitions define buckets type as

buckets: Record<string, TBucket> | TBucket[];

so we have to specify explicitly the bucket type we expect - object or array-based.
Hopefully, in the future, we will be able to infer a response type from a request type. For now, we declare it explicitly.

@mshustov mshustov added chore Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting v8.1.0 labels Nov 28, 2021
Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Viz editors changes LGTM!

Copy link
Member

@ashokaditya ashokaditya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security_solution changes LGTM. I only have a few suggestions for removing redundant union types that use undefined.

sortOrder?: estypes.SearchSortOrder;
searchAfterSortIds: estypes.SearchSortResults | undefined;
sortOrder?: estypes.SortOrder;
searchAfterSortIds: estypes.SortResults | undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
searchAfterSortIds: estypes.SortResults | undefined;
searchAfterSortIds?: estypes.SortResults;

Copy link
Member

@afharo afharo Dec 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashokaditya Happy to accept those changes. However, IMO, they are not exactly the same:
AFAIK, searchAfterSortIds: estypes.SortResults | undefined; enforces the property to be present but it accepts undefined. Setting a property as optional means that the property might not be provided.

It's a small difference, but depending on where it's used, it can catch some errors.

If you're happy with making the property optional, I'll gladly accept your suggestion :)

EDIT: I noticed about the agreement with Pierre. I also agree that it's better to make these changes in a separate PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@afharo yes quite right. At least in these cases, the types look like they are optional. Although it does make sense to explicitly define this so that the param is explicitly assigned undefined when that method is invoked if that is what is intended 👍

@@ -59,6 +59,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
`);
expectSnapshot(
response.body.traceDocs.map((doc) =>
// @ts-expect-error Property 'processor' does not exist on type 'Profile'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this (and the other @ts-expect-error before) indicate that the request body is not valid. I'll have a look.

Copy link
Member

@dgieselaar dgieselaar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving on behalf of APM UI, @walterra will also have a look at the changes in APM's correlations code (thank you Walter!)

@afharo
Copy link
Member

afharo commented Dec 22, 2021

Relaunching the tests because it looks like they fail due to timeouts in Buildkite (cc @elastic/kibana-operations)

@afharo
Copy link
Member

afharo commented Dec 22, 2021

@elasticmachine merge upstream

Copy link
Contributor

@justinkambic justinkambic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uptime change LGTM!

Copy link
Contributor

@stephmilovic stephmilovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for threat hunting, thank you

Copy link
Contributor

@walterra walterra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Transforms/ML/APM Correlations LGTM

Copy link
Contributor

@walterra walterra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Transforms/ML/APM Correlations LGTM

@afharo
Copy link
Member

afharo commented Dec 24, 2021

@elasticmachine merge upstream

@afharo
Copy link
Member

afharo commented Dec 24, 2021

I double-checked the changes for the 2 pending reviewers. The changes are minimal:

  1. @elastic/kibana-reporting-services: Update some test snapshots because of the removal of _type
  2. @elastic/security-telemetry: Add as const in some string declarations.

I'll merge after green CI.

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
core 997 1000 +3

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
discover 330.6KB 330.5KB -53.0B
stackAlerts 166.6KB 166.6KB +44.0B
total -9.0B

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
kibana 942 956 +14

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
data 441.1KB 441.0KB -8.0B
Unknown metric groups

API count

id before after diff
core 2326 2329 +3

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @afharo

@afharo afharo disabled auto-merge December 24, 2021 13:43
@afharo afharo merged commit 38feafa into elastic:main Dec 24, 2021
@mshustov mshustov deleted the issue-119454-es-upgrade branch December 25, 2021 15:34
Copy link
Member

@tsullivan tsullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@pjhampton pjhampton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌔 🚀 ✨ LGTM ✨ 🚀 🌔

Security telemetry changes look good!

@mshustov mshustov changed the title Update ES client to canary.37 Update ES client to 8.1.0-canary.2 Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting chore release_note:skip Skip the PR/issue when compiling release notes Team:APM All issues that need APM UI Team support Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Fleet Team label for Observability Data Collection Fleet team Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update ES client version to canary.37 Un-skip migration batch size test